
cmake_minimum_required(VERSION 3.0)

project(feature_extractor)

if(WIN32)  
  message(STATUS "Now is windows")
  set("PROJECT_BINARY_DIR" "${PROJECT_SOURCE_DIR}/vsbuild")  
elseif(APPLE)  
  message(STATUS "Now is Apple systens.")  
elseif(UNIX)  
  message(STATUS "Now is UNIX-like OS's. Including APPLE OS X and CygWin") 
  set("PROJECT_BINARY_DIR" "${PROJECT_SOURCE_DIR}/cygbuild")  
endif()  

# The version number.
set(HELLO_VERSION_MAJOR 0)


# add the binary tree to the search path for include files
include_directories("${PROJECT_BINARY_DIR}")

# add opencv library
if(WIN32)  
set(OpenCV_DIR "D:/Program Files/opencv/build")
endif()  
find_package(OpenCV REQUIRED)
set(EXTRA_LIBS ${EXTRA_LIBS} ${OpenCV_LIBS})

# add glog and flags library
if(WIN32)
set(GFLAGS_DIR "D:/glog/vsbuild")
set(GLOG_DIR "D:/glog/build")
endif()
find_package (gflags REQUIRED)
include_directories (${gflags_INCLUDE_DIR})
set(EXTRA_LIBS ${EXTRA_LIBS} gflags)

find_package (glog REQUIRED)
include_directories (${glog_INCLUDE_DIR})
set(EXTRA_LIBS ${EXTRA_LIBS} glog::glog)

find_package(OpenMP)
# enable OpenMP if compiler supports it
if(OpenMP_FOUND)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()

# add the executable
add_executable(fearure_repeat_task repeat_task.cc feature_task.cc feature.cc)
target_link_libraries(fearure_repeat_task ${EXTRA_LIBS})

# add the executable
add_executable(fearure_guided_task guided_task.cc feature_task.cc feature.cc)
target_link_libraries(fearure_guided_task ${EXTRA_LIBS})

